function [scheduledTargets, scheduledPriorities, consistent] = SCP_NetworkGrow(s1OlTargets, s1OlBins, s2OlTargets, s2OlBins, scheduledTargets, scheduledPriorities, target_id, priority)

if length(scheduledTargets) < 1
  scheduledTargets = target_id;
  scheduledPriorities = priority;
end

consistent = 1;
%relations(1:length(scheduledTargets)) = IA_Relation_Dummy();

for node = 1:length(scheduledTargets)
  node_id = scheduledTargets(node);
  if node_id == target_id
    consistent = 0;
    return;
  end
  
  relation1 = SCP_GenerateRelation(s1OlTargets, s1OlBins, target_id, node_id);
  relation2 = SCP_GenerateRelation(s2OlTargets, s2OlBins, target_id, node_id);
  %relations(node) = IA_Relation_Intersect(relation1, relation2);
  relation = relation1 & relation2; %#ok<AGROW>
  
  if all(all(relation == [0 0 0 0 0 0 0; 0 0 0 0 0 0 0])) %IA_Relation_Is_Null(relations(node))
    consistent = 0;
    return;
  elseif any(any(relation & [1 0 0 0 0 0 0; 0 0 0 0 0 0 0])) %IA_Relation_Has_Less(relations(node))
    consistent = 1;
    scheduledTargets = [scheduledTargets(1:node-1) target_id scheduledTargets(node:length(scheduledTargets))];
    scheduledPriorities = [scheduledPriorities(1:node-1) priority scheduledPriorities(node:length(scheduledPriorities))];
    return;
  end
end

if consistent
  scheduledTargets = [scheduledTargets target_id];
  scheduledPriorities = [scheduledPriorities priority];
end

% if consistent
%   %scheduledTargets = [scheduledTargets target_id];
%   %scheduledPriorities = [scheduledPriorities priority];
%   [scheduledTargets, scheduledPriorities, status] = SCP_InsertInterval(scheduledTargets, scheduledPriorities, relations, target_id, priority);
% end

end % function